import request from '@/utils/request'
/* 列表*/
export function getList(data) {
	return request({
		url: '/admin/race/lists',
		method: 'get',
		params: data
	})
}
// 详情
export function getInfo(data) {
	return request({
		url: '/admin/race/detail',
		method: 'get',
		params: data
	})
}
// 新增
export function addRace(data) {
	return request({
		url: '/admin/race/add',
		method: 'post',
		data
	})
}
// 编辑
export function editRace(data) {
	return request({
		url: '/admin/race/edit',
		method: 'post',
		data
	})
}
// 删除
export function deleteRace(data) {
	return request({
		url: '/admin/race/delete',
		method: 'post',
		data
	})
}
// 上下架
export function onOrOffRace(data) {
	return request({
		url: '/admin/race/on_or_off',
		method: 'post',
		data
	})
}
// 设置热门
export function hotRace(data) {
	return request({
		url: '/admin/race/is_hot',
		method: 'post',
		data
	})
}
// 分组停止报名
export function stopRace(data) {
	return request({
		url: '/admin/race/stop_apply',
		method: 'post',
		data
	})
}
// 新增分组
export function addRaceGroup(data) {
	return request({
		url: '/admin/race_group/add',
		method: 'post',
		data
	})
}
// 编辑分组
export function editRaceGroup(data) {
	return request({
		url: '/admin/race_group/edit',
		method: 'post',
		data
	})
}
// 删除分组
export function delRaceGroup(data) {
	return request({
		url: '/admin/race_group/delete',
		method: 'post',
		data
	})
}
// 全国省市接口
export function regionLists(data) {
	return request({
		url: '/admin/region',
		method: 'get',
		params: data
	})
}
// 城市列表
export function cityLists(data) {
	return request({
		url: '/admin/city/lists',
		method: 'get',
		params: data
	})
}
// 城市详情
export function cityDetail(data) {
	return request({
		url: '/admin/city/detail',
		method: 'get',
		params: data
	})
}
// 添加城市
export function cityAdd(data) {
	return request({
		url: '/admin/city/add',
		method: 'post',
		data
	})
}
// 编辑城市
export function cityEdit(data) {
	return request({
		url: '/admin/city/edit',
		method: 'post',
		data
	})
}
// 编辑城市
export function cityDelete(data) {
	return request({
		url: '/admin/city/delete',
		method: 'post',
		data
	})
}
// 赛事关联题目列表
export function raceQuestions(data) {
	return request({
		url: '/admin/race/questions',
		method: 'get',
		params: data
	})
}

// 赛事关联题目保存
export function bindQuestions(data) {
	return request({
		url: '/admin/race/bind_questions',
		method: 'post',
		data
	})
}
// 赛事上传成绩
export function importScore(data) {
	return request({
		url: '/admin/order/score',
		method: 'post',
		data
	})
}
// 赛事上传成绩模版
export function importScoreTemplate(data) {
	return request({
		url: '/admin/order/score_template',
		method: 'get',
		params: data
	})
}
// 赛事生成证书
export function certSave(data) {
	return request({
		url: '/admin/race/cert_params_save',
		method: 'post',
		data
	})
}
// 赛事证书预览
export function certPreview(data) {
	return request({
		url: '/admin/race/cert_preview',
		method: 'get',
		params: data
	})
}

// 赛事证书模版
export function certParams(data) {
	return request({
		url: '/admin/race/cert_params',
		method: 'get',
		params: data
	})
}

// 赛事证书模版
export function orderComplete(data) {
	return request({
		url: '/admin/order/complete',
		method: 'post',
		data
	})
}
// 下载签名
export function signDownload(data) {
	return request({
		url: '/admin/order/sign_download',
		method: 'get',
		params: data
	})
}

// 清空缓存
export function clearCache(data) {
	return request({
		url: '/race/race/clearCache/' + data.race_id,
		method: 'get',
		mode: 'wx'
	})
}